#pragma once
#define TEXTURE_RESOLUTION 2048
//resource classes
#include "GameResource.h"
#include "Mesh.h"
#include "Shader.h"
#include "Texture.h"
#include "Material.h"
#include "Model.h"
//frame buffer class
#include "FrameBuffer.h"
/*
	boost::shared_ptr does not support management of casted pointers, and prematurely deletes pointers that are shared among several sptr classes.
	As a solution, macros have been added that deal with pointer casting.
	When using resources, always store a copy of the sptr within the scope, as to prevent the pointer from being prematurely deleted.
	Arseni Natapov, 1/10/2011
*/
//resource access macro
#define _RESC(name)			globals.Content.Get(name)
//resource casting macros
#define _TEXTURE(s_ptr)		dynamic_cast<Texture*>(s_ptr.get())
#define _SHADER(s_ptr)		dynamic_cast<Shader*>(s_ptr.get())
#define _MESH(s_ptr)		dynamic_cast<Mesh*>(s_ptr.get())
#define _MATERIAL(s_ptr)	dynamic_cast<Material*>(s_ptr.get())
#define _MODEL(s_ptr)		dynamic_cast<Model*>(s_ptr.get())
//actor classes
#include "Actor.h"
#include "Light.h"
#include "Camera.h"
#include "Pawn.h"
//In the same way as with Game Resources.
//actor access macro
#define _ACTOR(name)		globals.Game.MainScene->Get(name)
//actor casting macros
#define _LIGHT(s_ptr)		dynamic_cast<Light*>(s_ptr.get())
#define _CAMERA(s_ptr)		dynamic_cast<Camera*>(s_ptr.get())
#define _PAWN(s_ptr)		dynamic_cast<Pawn*>(s_ptr.get())

#define _ALL_LIGHTS			GetAllActors<Light>()
#define _ALL_PAWNS			GetAllActors<Pawn>()
#define _MAIN_CAMERA		globals.Game.MainScene->MainCamera
#define _MAIN_SCENE			globals.Game.MainScene->Physics
#define _PLAYER				_PAWN(_ACTOR("PacMan"))
#define _PLAYER_MODEL		_PLAYER->Models[0]
#define _PROJECTION(camera) ProjectionMatrix(camera->FOV,camera->AspectRatio, camera->NearViewPlane, camera->FarViewPlane)
#define _VIEW(camera)		ViewMatrix(camera->GetPos(),camera->GetAt(),camera->GetUp())
#define _WORLDVIEWPROJ(camera, pos, rot, scale) (_PROJECTION(camera)*_VIEW(camera))*(TranslationMatrix(pos)*RotationMatrix(rot)*ScalingMatrix(scale))
//scene
#include "Scene.h"
//Singleton classes
#include "GameManager.h"
#include "GraphicsManager.h"
#include "ContentManager.h"
#include "InputManager.h"
#include "SingletonManager.h"
//helper functions
#include "HelperFunctions.h"
